// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue'
import VueI18n from 'vue-i18n'
//
import App from './App'
import store from '../store/index'
import VueCookies from 'vue-cookies'
import BaseModule from './common/base'
import Api from './api'
import VueLazyload from 'vue-lazyload'

//
import './assets/less/global.less'
import './assets/css/ionicons/ionicons.css'
import 'lib-flexible/flexible'
import {
  Toast,
  Dialog
} from 'vant'

import router from './router2'

Vue.use(VueI18n)
Vue.use(Toast)
Vue.use(Dialog)
Vue.use(VueLazyload)
Vue.use(VueCookies)
Vue.use(BaseModule)
Vue.use(Api)

const i18n = new VueI18n({
  locale: 'zh-CN', // 语言标识
  messages: {
    'zh-CN': require('./common/lang/zh-CN'), // 中文语言包
    'en': require('./common/lang/en') // 英文语言包
  }
})

/* eslint-disable no-new */
new Vue({
  el: '#app',
  i18n,
  store,
  router,
  components: {
    App
  },
  template: '<App/>',
  beforeCreate () {
    console.group('Vue')
    console.log('[Timeline beforeCreate]')
  },
  mounted () {
    console.log('[Timeline mounted]')
    this.$toast.setDefaultOptions({
      position: 'bottom',
      className: 'toast-small'
    })
  }
})
console.groupEnd('Vue')
